#ifndef NOTEDB_H
#define NOTEDB_H
#include <QSqlDatabase>
#include <QSqlQuery>
#include <QSqlResult>

#include "imageInfo.h"

class NoteDB
{
public:

    static void insert(ImageInfo &info);
    static void deleteOne(QString id);
    static void deleteAll();
    static void update(ImageInfo info);
    static void insertOrUpdate(ImageInfo &info);
    static bool exist(QString id);
    static QSqlQuery findAll();
    static void closeDB();

private:
    NoteDB();
    ~NoteDB();
    QSqlDatabase db;
    QSqlQuery getQuery();

    bool open();
    void close();


    static NoteDB* instance;
    static NoteDB *getInstance();
};

#endif // NOTEDB_H
